
function Link_throughput=GetThroughputSamples(file_name, sample_size)
  %number_of_links = 111;
  Link_throughput=[];
  f_id = fopen(file_name);
  while ~feof(f_id)
    line = fgetl (f_id);
    throughput_records = str2num (line);
    [m,n] = size(throughput_records);
    columns = 2:1:n; % remove the sender id
    [x,y]=size(columns); % 1, 5679
    if y ~= 0
        selected_columns = ceil(rand(1,sample_size) * y);
        Link_throughput= [Link_throughput, throughput_records(selected_columns)];
    end
  end
  %{
  throughput = importdata(file_name);
  [m,n] = size(throughput)
  %throughput = ~isnan(throughput)
  %Link_throughput=zeros(m,3);
  Link_throughput=[];

  for index=1:1:m
    %Link_throughput(index,1)=throughput(index,1);% sender id
    %Link_throughput(index,2)=throughput(index,2);% receiver id
    non_zero_values = throughput (index, find (throughput (index, :) >= 0));
    [m,n] = size(non_zero_values);
    columns = 2:1:n; % remove the sender id
    [x,y]=size(columns); % 1, 5679
    if y ~= 0
        selected_columns = ceil(rand(1,sample_size) * y);
        Link_throughput= [Link_throughput, non_zero_values(selected_columns)];
    end
  end
  %}
end
